﻿using UnityEditor;
using UnityEngine;
using System.Collections.Generic;

namespace HKTools
{
    [CustomEditor(typeof(HK_TaskList))]
    public class HK_TaskListEitor : Editor
    {
        public override void OnInspectorGUI()
        {
            HK_TaskList taskList = target as HK_TaskList;

            EditorGUILayout.Space(5);

            if (GUILayout.Button("添加新任务"))
            {
                HK_Task newTask = new HK_Task();

                if (taskList.list == null)
                    taskList.list = new List<HK_Task>();

                taskList.list.Add(newTask);
            }

            EditorGUILayout.Space(10);

            base.OnInspectorGUI();
        }
    }
}